BEGIN;
CREATE TABLE `django_content_type` (
    `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
    `name` varchar(100) NOT NULL,
    `app_label` varchar(100) NOT NULL,
    `model` varchar(100) NOT NULL,
    UNIQUE (`app_label`, `model`)
)
;
COMMIT;
BEGIN;
CREATE TABLE `django_session` (
    `session_key` varchar(40) NOT NULL PRIMARY KEY,
    `session_data` longtext NOT NULL,
    `expire_date` datetime NOT NULL
)
;
COMMIT;
BEGIN;
CREATE TABLE `django_site` (
    `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
    `domain` varchar(100) NOT NULL,
    `name` varchar(50) NOT NULL
)
;
COMMIT;
BEGIN;
CREATE TABLE `auth_permission` (
    `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
    `name` varchar(50) NOT NULL,
    `content_type_id` integer NOT NULL,
    `codename` varchar(100) NOT NULL,
    UNIQUE (`content_type_id`, `codename`)
)
;
ALTER TABLE `auth_permission` ADD CONSTRAINT `content_type_id_refs_id_728de91f` FOREIGN KEY (`content_type_id`) REFERENCES `django_content_type` (`id`);
CREATE TABLE `auth_group_permissions` (
    `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
    `group_id` integer NOT NULL,
    `permission_id` integer NOT NULL,
    UNIQUE (`group_id`, `permission_id`)
)
;
ALTER TABLE `auth_group_permissions` ADD CONSTRAINT `permission_id_refs_id_5886d21f` FOREIGN KEY (`permission_id`) REFERENCES `auth_permission` (`id`);
CREATE TABLE `auth_group` (
    `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
    `name` varchar(80) NOT NULL UNIQUE
)
;
ALTER TABLE `auth_group_permissions` ADD CONSTRAINT `group_id_refs_id_3cea63fe` FOREIGN KEY (`group_id`) REFERENCES `auth_group` (`id`);
CREATE TABLE `auth_user_user_permissions` (
    `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
    `user_id` integer NOT NULL,
    `permission_id` integer NOT NULL,
    UNIQUE (`user_id`, `permission_id`)
)
;
ALTER TABLE `auth_user_user_permissions` ADD CONSTRAINT `permission_id_refs_id_67e79cb` FOREIGN KEY (`permission_id`) REFERENCES `auth_permission` (`id`);
CREATE TABLE `auth_user_groups` (
    `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
    `user_id` integer NOT NULL,
    `group_id` integer NOT NULL,
    UNIQUE (`user_id`, `group_id`)
)
;
ALTER TABLE `auth_user_groups` ADD CONSTRAINT `group_id_refs_id_f116770` FOREIGN KEY (`group_id`) REFERENCES `auth_group` (`id`);
CREATE TABLE `auth_user` (
    `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
    `username` varchar(30) NOT NULL UNIQUE,
    `first_name` varchar(30) NOT NULL,
    `last_name` varchar(30) NOT NULL,
    `email` varchar(75) NOT NULL,
    `password` varchar(128) NOT NULL,
    `is_staff` bool NOT NULL,
    `is_active` bool NOT NULL,
    `is_superuser` bool NOT NULL,
    `last_login` datetime NOT NULL,
    `date_joined` datetime NOT NULL
)
;
ALTER TABLE `auth_user_user_permissions` ADD CONSTRAINT `user_id_refs_id_dfbab7d` FOREIGN KEY (`user_id`) REFERENCES `auth_user` (`id`);
ALTER TABLE `auth_user_groups` ADD CONSTRAINT `user_id_refs_id_7ceef80f` FOREIGN KEY (`user_id`) REFERENCES `auth_user` (`id`);
CREATE TABLE `auth_message` (
    `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
    `user_id` integer NOT NULL,
    `message` longtext NOT NULL
)
;
ALTER TABLE `auth_message` ADD CONSTRAINT `user_id_refs_id_650f49a6` FOREIGN KEY (`user_id`) REFERENCES `auth_user` (`id`);
CREATE INDEX `auth_permission_1bb8f392` ON `auth_permission` (`content_type_id`);
CREATE INDEX `auth_message_403f60f` ON `auth_message` (`user_id`);
COMMIT;
BEGIN;
CREATE TABLE `django_admin_log` (
    `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
    `action_time` datetime NOT NULL,
    `user_id` integer NOT NULL,
    `content_type_id` integer,
    `object_id` longtext,
    `object_repr` varchar(200) NOT NULL,
    `action_flag` smallint UNSIGNED NOT NULL,
    `change_message` longtext NOT NULL
)
;
ALTER TABLE `django_admin_log` ADD CONSTRAINT `content_type_id_refs_id_288599e6` FOREIGN KEY (`content_type_id`) REFERENCES `django_content_type` (`id`);
ALTER TABLE `django_admin_log` ADD CONSTRAINT `user_id_refs_id_c8665aa` FOREIGN KEY (`user_id`) REFERENCES `auth_user` (`id`);
CREATE INDEX `django_admin_log_403f60f` ON `django_admin_log` (`user_id`);
CREATE INDEX `django_admin_log_1bb8f392` ON `django_admin_log` (`content_type_id`);
COMMIT;
BEGIN;
CREATE TABLE `socialauth_authmeta` (
    `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
    `user_id` integer NOT NULL,
    `provider` varchar(200) NOT NULL,
    `is_email_filled` bool NOT NULL,
    `is_profile_modified` bool NOT NULL
)
;
ALTER TABLE `socialauth_authmeta` ADD CONSTRAINT `user_id_refs_id_7b366468` FOREIGN KEY (`user_id`) REFERENCES `auth_user` (`id`);
CREATE TABLE `socialauth_openidprofile` (
    `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
    `openid_key` varchar(200) NOT NULL UNIQUE,
    `user_id` integer NOT NULL,
    `is_username_valid` bool NOT NULL,
    `email` varchar(75) NOT NULL,
    `nickname` varchar(100) NOT NULL
)
;
ALTER TABLE `socialauth_openidprofile` ADD CONSTRAINT `user_id_refs_id_2ffc3ca4` FOREIGN KEY (`user_id`) REFERENCES `auth_user` (`id`);
CREATE TABLE `socialauth_linkedinuserprofile` (
    `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
    `linkedin_uid` varchar(50) NOT NULL UNIQUE,
    `user_id` integer NOT NULL,
    `headline` varchar(120),
    `company` varchar(255),
    `location` longtext,
    `industry` varchar(255),
    `profile_image_url` varchar(200),
    `url` varchar(200),
    `access_token` varchar(255)
)
;
ALTER TABLE `socialauth_linkedinuserprofile` ADD CONSTRAINT `user_id_refs_id_46294af2` FOREIGN KEY (`user_id`) REFERENCES `auth_user` (`id`);
CREATE TABLE `socialauth_twitteruserprofile` (
    `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
    `screen_name` varchar(200) NOT NULL UNIQUE,
    `user_id` integer NOT NULL,
    `access_token` varchar(255),
    `profile_image_url` varchar(200),
    `location` longtext,
    `url` varchar(200),
    `description` varchar(160)
)
;
ALTER TABLE `socialauth_twitteruserprofile` ADD CONSTRAINT `user_id_refs_id_11ac7e4` FOREIGN KEY (`user_id`) REFERENCES `auth_user` (`id`);
CREATE TABLE `socialauth_facebookuserprofile` (
    `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
    `facebook_uid` varchar(20) NOT NULL UNIQUE,
    `user_id` integer NOT NULL,
    `profile_image_url` varchar(200),
    `profile_image_url_big` varchar(200),
    `profile_image_url_small` varchar(200),
    `location` longtext,
    `url` varchar(200),
    `about_me` varchar(160)
)
;
ALTER TABLE `socialauth_facebookuserprofile` ADD CONSTRAINT `user_id_refs_id_3b80ccbc` FOREIGN KEY (`user_id`) REFERENCES `auth_user` (`id`);
CREATE INDEX `socialauth_authmeta_403f60f` ON `socialauth_authmeta` (`user_id`);
CREATE INDEX `socialauth_openidprofile_403f60f` ON `socialauth_openidprofile` (`user_id`);
CREATE INDEX `socialauth_linkedinuserprofile_403f60f` ON `socialauth_linkedinuserprofile` (`user_id`);
CREATE INDEX `socialauth_twitteruserprofile_403f60f` ON `socialauth_twitteruserprofile` (`user_id`);
CREATE INDEX `socialauth_facebookuserprofile_403f60f` ON `socialauth_facebookuserprofile` (`user_id`);
COMMIT;
BEGIN;
CREATE TABLE `openid_consumer_nonce` (
    `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
    `server_url` varchar(200) NOT NULL,
    `timestamp` integer NOT NULL,
    `salt` varchar(50) NOT NULL
)
;
CREATE TABLE `openid_consumer_association` (
    `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
    `server_url` longtext NOT NULL,
    `handle` varchar(255) NOT NULL,
    `secret` longtext NOT NULL,
    `issued` integer NOT NULL,
    `lifetime` integer NOT NULL,
    `assoc_type` longtext NOT NULL
)
;
COMMIT;
BEGIN;
CREATE TABLE `dict_lang` (
    `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
    `code` varchar(2) NOT NULL UNIQUE,
    `name` varchar(32) NOT NULL
)
;
CREATE TABLE `dict_term` (
    `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
    `term` varchar(64) NOT NULL UNIQUE,
    `frequency` integer NOT NULL,
    `language_id` integer NOT NULL,
    `enabled` bool NOT NULL,
    `reviewed` bool NOT NULL
)
;
ALTER TABLE `dict_term` ADD CONSTRAINT `language_id_refs_id_4a9ffbfd` FOREIGN KEY (`language_id`) REFERENCES `dict_lang` (`id`);
CREATE INDEX `dict_term_7ab48146` ON `dict_term` (`language_id`);
COMMIT;
BEGIN;
CREATE TABLE `ams_advertizer` (
    `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
    `user_id` integer NOT NULL,
    `type` varchar(32) NOT NULL,
    `title` varchar(255) NOT NULL UNIQUE,
    `description` longtext NOT NULL
)
;
ALTER TABLE `ams_advertizer` ADD CONSTRAINT `user_id_refs_id_61345e44` FOREIGN KEY (`user_id`) REFERENCES `auth_user` (`id`);
CREATE TABLE `ams_ad` (
    `uuid` varchar(32) NOT NULL PRIMARY KEY,
    `id` varchar(16) NOT NULL,
    `advertizer_id` integer NOT NULL,
    `title` varchar(256) NOT NULL,
    `description` longtext NOT NULL,
    `registration_date` date NOT NULL,
    `start_date` date NOT NULL,
    `end_date` date NOT NULL,
    `url` varchar(200),
    `enabled` bool NOT NULL,
    `stats_id` integer UNIQUE,
    UNIQUE (`advertizer_id`, `id`)
)
;
ALTER TABLE `ams_ad` ADD CONSTRAINT `advertizer_id_refs_id_7b23d22` FOREIGN KEY (`advertizer_id`) REFERENCES `ams_advertizer` (`id`);
CREATE TABLE `ams_adprofile` (
    `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
    `ad_id` varchar(32) NOT NULL UNIQUE,
    `key` varchar(64) NOT NULL,
    `value` longtext NOT NULL,
    UNIQUE (`ad_id`, `key`)
)
;
ALTER TABLE `ams_adprofile` ADD CONSTRAINT `ad_id_refs_uuid_12c71fd1` FOREIGN KEY (`ad_id`) REFERENCES `ams_ad` (`uuid`);
CREATE TABLE `ams_adtag` (
    `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
    `last_modified` datetime NOT NULL,
    `ad_id` varchar(32) NOT NULL,
    `term_id` integer NOT NULL
)
;
ALTER TABLE `ams_adtag` ADD CONSTRAINT `term_id_refs_id_199f1b9b` FOREIGN KEY (`term_id`) REFERENCES `dict_term` (`id`);
ALTER TABLE `ams_adtag` ADD CONSTRAINT `ad_id_refs_uuid_1b38fb50` FOREIGN KEY (`ad_id`) REFERENCES `ams_ad` (`uuid`);
CREATE TABLE `hst_adlikedislike` (
    `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
    `ad_id` varchar(32) NOT NULL,
    `user_id` integer,
    `score` integer NOT NULL,
    `last_modified` datetime NOT NULL
)
;
ALTER TABLE `hst_adlikedislike` ADD CONSTRAINT `user_id_refs_id_3fc72dae` FOREIGN KEY (`user_id`) REFERENCES `auth_user` (`id`);
ALTER TABLE `hst_adlikedislike` ADD CONSTRAINT `ad_id_refs_uuid_1562c8ee` FOREIGN KEY (`ad_id`) REFERENCES `ams_ad` (`uuid`);
CREATE TABLE `hst_adview` (
    `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
    `ad_id` varchar(32) NOT NULL,
    `user_id` integer,
    `last_modified` datetime NOT NULL,
    `referer` varchar(256),
    `viewer_ip` char(15),
    UNIQUE (`ad_id`, `user_id`, `last_modified`)
)
;
ALTER TABLE `hst_adview` ADD CONSTRAINT `user_id_refs_id_5dd826e6` FOREIGN KEY (`user_id`) REFERENCES `auth_user` (`id`);
ALTER TABLE `hst_adview` ADD CONSTRAINT `ad_id_refs_uuid_1b2eb8e6` FOREIGN KEY (`ad_id`) REFERENCES `ams_ad` (`uuid`);
CREATE TABLE `hst_adstats` (
    `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
    `ad_id` varchar(32) NOT NULL UNIQUE,
    `score` integer NOT NULL,
    `views` integer NOT NULL,
    `likes` integer NOT NULL,
    `dislikes` integer NOT NULL,
    `last_modified` datetime NOT NULL
)
;
ALTER TABLE `hst_adstats` ADD CONSTRAINT `ad_id_refs_uuid_69ac467b` FOREIGN KEY (`ad_id`) REFERENCES `ams_ad` (`uuid`);
ALTER TABLE `ams_ad` ADD CONSTRAINT `stats_id_refs_id_2f25d113` FOREIGN KEY (`stats_id`) REFERENCES `hst_adstats` (`id`);
CREATE TABLE `hst_adsearch` (
    `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
    `user_id` integer,
    `term_id` integer NOT NULL,
    `viewed_on` datetime NOT NULL
)
;
ALTER TABLE `hst_adsearch` ADD CONSTRAINT `term_id_refs_id_76b787c0` FOREIGN KEY (`term_id`) REFERENCES `dict_term` (`id`);
ALTER TABLE `hst_adsearch` ADD CONSTRAINT `user_id_refs_id_c537a39` FOREIGN KEY (`user_id`) REFERENCES `auth_user` (`id`);
CREATE TABLE `hst_adtag_explr` (
    `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
    `user_id` integer,
    `term_id` integer NOT NULL,
    `viewed_on` datetime NOT NULL,
    `referer` varchar(256),
    `viewer_ip` char(15)
)
;
ALTER TABLE `hst_adtag_explr` ADD CONSTRAINT `term_id_refs_id_40046b31` FOREIGN KEY (`term_id`) REFERENCES `dict_term` (`id`);
ALTER TABLE `hst_adtag_explr` ADD CONSTRAINT `user_id_refs_id_707b5f68` FOREIGN KEY (`user_id`) REFERENCES `auth_user` (`id`);
CREATE TABLE `ams_adorder` (
    `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
    `ad_id` varchar(32) NOT NULL,
    `amount` double precision NOT NULL,
    `paid` bool NOT NULL,
    `payment_date` datetime
)
;
ALTER TABLE `ams_adorder` ADD CONSTRAINT `ad_id_refs_uuid_53873a1a` FOREIGN KEY (`ad_id`) REFERENCES `ams_ad` (`uuid`);
CREATE TABLE `ams_adpricing` (
    `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
    `enabled` bool NOT NULL,
    `is_default` bool NOT NULL,
    `daily_rate` double precision NOT NULL,
    `min_days_discount` integer UNSIGNED,
    `min_days_discount_forevery` integer UNSIGNED,
    `min_days_discount_rate` integer UNSIGNED,
    `range_discount_start` date,
    `range_discount_end` date,
    `range_discount_forevery` integer UNSIGNED,
    `range_discount_rate` integer UNSIGNED
)
;
CREATE INDEX `ams_advertizer_403f60f` ON `ams_advertizer` (`user_id`);
CREATE INDEX `ams_ad_608cb1cc` ON `ams_ad` (`advertizer_id`);
CREATE INDEX `ams_adprofile_45544485` ON `ams_adprofile` (`key`);
CREATE INDEX `ams_adtag_51c59e2f` ON `ams_adtag` (`ad_id`);
CREATE INDEX `ams_adtag_e17cbae` ON `ams_adtag` (`term_id`);
CREATE INDEX `hst_adlikedislike_51c59e2f` ON `hst_adlikedislike` (`ad_id`);
CREATE INDEX `hst_adlikedislike_403f60f` ON `hst_adlikedislike` (`user_id`);
CREATE INDEX `hst_adview_51c59e2f` ON `hst_adview` (`ad_id`);
CREATE INDEX `hst_adview_403f60f` ON `hst_adview` (`user_id`);
CREATE INDEX `hst_adsearch_403f60f` ON `hst_adsearch` (`user_id`);
CREATE INDEX `hst_adsearch_e17cbae` ON `hst_adsearch` (`term_id`);
CREATE INDEX `hst_adtag_explr_403f60f` ON `hst_adtag_explr` (`user_id`);
CREATE INDEX `hst_adtag_explr_e17cbae` ON `hst_adtag_explr` (`term_id`);
CREATE INDEX `ams_adorder_51c59e2f` ON `ams_adorder` (`ad_id`);
COMMIT;
BEGIN;
CREATE TABLE `pay_credit` (
    `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
    `user_id` integer NOT NULL UNIQUE,
    `balance` double precision NOT NULL,
    `last_modified` datetime NOT NULL
)
;
ALTER TABLE `pay_credit` ADD CONSTRAINT `user_id_refs_id_18fd8614` FOREIGN KEY (`user_id`) REFERENCES `auth_user` (`id`);
CREATE TABLE `pay_credit_history` (
    `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
    `credit_id` integer NOT NULL,
    `amount` double precision NOT NULL,
    `order_id` integer NOT NULL UNIQUE,
    `last_modified` datetime NOT NULL
)
;
ALTER TABLE `pay_credit_history` ADD CONSTRAINT `order_id_refs_id_65d6f428` FOREIGN KEY (`order_id`) REFERENCES `ams_adorder` (`id`);
ALTER TABLE `pay_credit_history` ADD CONSTRAINT `credit_id_refs_id_7a62baba` FOREIGN KEY (`credit_id`) REFERENCES `pay_credit` (`id`);
CREATE TABLE `pay_dpst_crdt_history` (
    `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
    `credit_id` integer NOT NULL,
    `amount` double precision NOT NULL,
    `last_modified` datetime NOT NULL
)
;
ALTER TABLE `pay_dpst_crdt_history` ADD CONSTRAINT `credit_id_refs_id_1aa400af` FOREIGN KEY (`credit_id`) REFERENCES `pay_credit` (`id`);
CREATE TABLE `pay_policy` (
    `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
    `name` varchar(32) NOT NULL,
    `isfree` bool NOT NULL
)
;
CREATE TABLE `pay_userpolicy` (
    `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
    `user_id` integer NOT NULL,
    `policy_id` integer NOT NULL,
    UNIQUE (`user_id`, `policy_id`)
)
;
ALTER TABLE `pay_userpolicy` ADD CONSTRAINT `policy_id_refs_id_66b53734` FOREIGN KEY (`policy_id`) REFERENCES `pay_policy` (`id`);
ALTER TABLE `pay_userpolicy` ADD CONSTRAINT `user_id_refs_id_4cb18f98` FOREIGN KEY (`user_id`) REFERENCES `auth_user` (`id`);
CREATE INDEX `pay_credit_history_1194fd3b` ON `pay_credit_history` (`credit_id`);
CREATE INDEX `pay_dpst_crdt_history_1194fd3b` ON `pay_dpst_crdt_history` (`credit_id`);
CREATE INDEX `pay_userpolicy_403f60f` ON `pay_userpolicy` (`user_id`);
CREATE INDEX `pay_userpolicy_17b05d50` ON `pay_userpolicy` (`policy_id`);
COMMIT;
BEGIN;
CREATE TABLE `private_messages_message` (
    `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
    `subject` varchar(120) NOT NULL,
    `body` longtext NOT NULL,
    `sender_id` integer NOT NULL,
    `recipient_id` integer,
    `parent_msg_id` integer,
    `sent_at` datetime,
    `read_at` datetime,
    `replied_at` datetime,
    `sender_deleted_at` datetime,
    `recipient_deleted_at` datetime
)
;
ALTER TABLE `private_messages_message` ADD CONSTRAINT `sender_id_refs_id_9c0e2d4` FOREIGN KEY (`sender_id`) REFERENCES `auth_user` (`id`);
ALTER TABLE `private_messages_message` ADD CONSTRAINT `recipient_id_refs_id_9c0e2d4` FOREIGN KEY (`recipient_id`) REFERENCES `auth_user` (`id`);
ALTER TABLE `private_messages_message` ADD CONSTRAINT `parent_msg_id_refs_id_59c4d16b` FOREIGN KEY (`parent_msg_id`) REFERENCES `private_messages_message` (`id`);
CREATE INDEX `private_messages_message_6fe0a617` ON `private_messages_message` (`sender_id`);
CREATE INDEX `private_messages_message_32f69dc` ON `private_messages_message` (`recipient_id`);
CREATE INDEX `private_messages_message_201a85d4` ON `private_messages_message` (`parent_msg_id`);
COMMIT;
BEGIN;
CREATE TABLE `faq_topic` (
    `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
    `name` varchar(150) NOT NULL,
    `slug` varchar(150) NOT NULL,
    `sort_order` integer NOT NULL
)
;
CREATE TABLE `faq_question` (
    `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
    `created_by_id` integer,
    `created_on` datetime NOT NULL,
    `updated_on` datetime NOT NULL,
    `updated_by_id` integer,
    `slug` varchar(100) NOT NULL,
    `topic_id` integer,
    `text` longtext NOT NULL,
    `answer` longtext NOT NULL,
    `status` integer NOT NULL,
    `sort_order` integer NOT NULL,
    `protected` bool NOT NULL
)
;
ALTER TABLE `faq_question` ADD CONSTRAINT `topic_id_refs_id_2055b767` FOREIGN KEY (`topic_id`) REFERENCES `faq_topic` (`id`);
ALTER TABLE `faq_question` ADD CONSTRAINT `created_by_id_refs_id_225e74d5` FOREIGN KEY (`created_by_id`) REFERENCES `auth_user` (`id`);
ALTER TABLE `faq_question` ADD CONSTRAINT `updated_by_id_refs_id_225e74d5` FOREIGN KEY (`updated_by_id`) REFERENCES `auth_user` (`id`);
CREATE INDEX `faq_topic_56ae2a2a` ON `faq_topic` (`slug`);
CREATE INDEX `faq_question_4a21cf42` ON `faq_question` (`created_by_id`);
CREATE INDEX `faq_question_6f403c1` ON `faq_question` (`updated_by_id`);
CREATE INDEX `faq_question_56ae2a2a` ON `faq_question` (`slug`);
CREATE INDEX `faq_question_57732028` ON `faq_question` (`topic_id`);
COMMIT;
